package com.vinci.wishDemo.service.impl;

import com.vinci.wishDemo.entity.TbContentAppreciate;
import com.vinci.wishDemo.entity.TbContentTopic;
import com.vinci.wishDemo.mapper.TbContentTopicMapper;
import com.vinci.wishDemo.service.TbContentTopicService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 话题表 服务实现类
 * </p>
 *
 * @author 郭三木
 * @since 2021-12-10
 */
@Service
public class TbContentTopicServiceImpl extends ServiceImpl<TbContentTopicMapper, TbContentTopic> implements TbContentTopicService {
    @Resource
    private TbContentTopicMapper topicMapper;

    /*
    查看话题详情
     */
    @Override
    public List<TbContentTopic> querytopList(String createBy, String beginTime, String endTime) {
        List<TbContentTopic> tbContentTopics = null;
        try {
            tbContentTopics = topicMapper.querytopList(createBy, beginTime, endTime);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return tbContentTopics;
    }

    /*
    删除话题记录
     */
    @Override
    public void deltop(String topicId) {
        try {
            topicMapper.deltop(topicId);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    /*
    查询当前话题状态
     */
    @Override
    public TbContentTopic querystats(String topicId) {
        TbContentTopic topstats = null;
        try {
            topstats= topicMapper.querystats(topicId);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return topstats;
    }
}
